package com.example.member.config;

import com.example.member.interceptor.Demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private Demo demo;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 配置拦截器对象
        registry.addInterceptor(demo)
                // 设置生效
                .addPathPatterns()
                // 用于配置微服务之间通过fegin调用直接放行
                
                .excludePathPatterns("/123/456/789");

    }

}
